<?php

class usuario_model extends CI_Model {

    public function acceso($params) {
        $sql="call sp_Acceso(?,?)";
        $query = $this->db->query($sql,$params);
        if ($query->num_rows() > 0) {
            $data = $query->result_array();
        }else {
            $data = null;
        }
        return $data;
    }

    public function usuarios() {
        $sql = "call sp_usuarios()";
        $query = $this->db->query($sql);
        $data[""] = "";
        if ($query->num_rows() > 0) {
            foreach ($query->result() as $fila) :
                $data[htmlspecialchars($fila->cod_usu, ENT_QUOTES)] = htmlspecialchars($fila->usuario, ENT_QUOTES);
            endforeach;
            $query->free_result();
        }else {
            $data = array("no se encontraron " . $tipo . "s");
        }
        return $data;
    }
    
    public function U_Cuenta($params){
        $sql="call sp_U_Cuenta(?,?,?)";
        $this->db->query($sql, $params);
    }

}

?>
